#pragma once
#include "../Utility/IOInterface.hpp"
#include "../Utility/Uncopyable.hpp"
#include "RapidXMLNode.hpp"
#include <Math/Array.hpp>
namespace zzz{
class ZCORE_CLASS RapidXML : public IOData, public Uncopyable
{
public:
  bool LoadFile(const string &);
  bool SaveFile(const string &);

  zuint NodeNumber() const;
  RapidXMLNode GetNode(zuint i);
  RapidXMLNode GetNode(const string &name);
  bool HasNode(const string &name);
  RapidXMLNode AppendNode(const string &name);
  bool RemoveNode(const string &name);
  bool RemoveNode(zuint i);

  const string& GetFilename() const;
private:
  rapidxml::xml_document<> doc_;
  string filename_;
  Array<1,char> filetext_;

};
}
